require("oo")

-- define the class
class_definition = 
{
    -- constructor 
    construct = function(self, arg1, arg2, arg3)
        print(self, arg1, arg2, arg3)
        -- set member variables
        rawset(self, "num", 3) 
        rawset(self, "text", "hello") 
    end,

    -- method definitions
    f = function(self, x) 
        --print(self)
        return x * self.num 
    end,

    -- static(class) members
    num2 = 5,
    text2 = "hello2",
}

-- create class A
A = oo.class("A", class_definition)

-- create instance of class A
a = A.new(1, "a", 3)

-- create another instance of class A
aa = A.new()

print(a:f(3))
print(a.num2)
a.num2 = 33
print(aa.num2)
print(a.text)
aa.text = "hello world!"
print(a.text)

